package cn.xxliang.platapp.controller;

import cn.xxliang.platapp.common.BaseRespWithData;
import cn.xxliang.platapp.pojo.dto.AppSystemDto;
import cn.xxliang.platapp.pojo.query.AppSystemQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

@RestController
@RequestMapping("/appSystem")
@Api(tags = "应用信息管理")
@Validated
public class AppSystemController {

    @PostMapping("/add")
    @ApiOperation("添加应用信息")
    public BaseRespWithData add(@RequestBody @Valid AppSystemDto dto) {
        return new BaseRespWithData().code(200).msg("添加成功");
    }

    @GetMapping("/get")
    @ApiOperation("查询应用信息")
    public BaseRespWithData get(@RequestParam @NotNull(message = "主键不能为空") String appSystemId) {
        return new BaseRespWithData().code(200).msg("查询成功");
    }

    @GetMapping("/delete")
    @ApiOperation("删除应用信息")
    public BaseRespWithData delete(@RequestParam @NotNull(message = "主键不能为空") String appSystemId) {
        return new BaseRespWithData().code(200).msg("删除成功");
    }

    @PostMapping("/update")
    @ApiOperation("更新应用信息")
    public BaseRespWithData update(@RequestBody @Valid AppSystemDto dto) {
        return new BaseRespWithData().code(200).msg("更新成功");
    }

    @PostMapping("/list")
    @ApiOperation("查询应用信息列表")
    public BaseRespWithData list(@RequestBody @Valid AppSystemQuery query) {
        return new BaseRespWithData().code(200).msg("查询成功");
    }
}


